"""
@filename=main.py
@version=0.1.0.20240110
@author=amnotgcs
@createTime=20240110 20:13
@lastModifiedTime=20240110 20:13
@description=程序入口文件
"""
from utils import is_folder_exists
from config import PERSISTENCE_FOLDER, PERSISTENCE_HTML_FOLDER, PERSISTENCE_PDF_FOLDER
from get_html import get_all_sinopec_bidding, get_sinopec_bidding_amount, get_all_sinopec_bidding_info


def main() -> None:
    """程序入口函数"""
    if not all([
        is_folder_exists(PERSISTENCE_FOLDER),
        is_folder_exists(PERSISTENCE_HTML_FOLDER),
        is_folder_exists(PERSISTENCE_PDF_FOLDER),
    ]):
        raise Exception('存放数据的文件夹创建失败,程序中止')
    # 要下载文件,执行下面两行
    # bidding_amount = get_sinopec_bidding_amount()
    # get_all_sinopec_bidding(1, bidding_amount.get('total_page_amount'))

    # 要获取信息,执行下面一行,页码自定义
    get_all_sinopec_bidding_info(1, 20)


if __name__ == '__main__':
    main()
